package get.data;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ListView;

public class PowerStatus extends Activity{
	
	private NodeAdaptor nodeAdaptor = new NodeAdaptor(this,2);
	private ListView listView;
	
    public void onCreate(Bundle savedInstanceState) {
    	
        super.onCreate(savedInstanceState);
        setContentView(R.layout.view_parametres);
        
        listView = (ListView)findViewById(R.id.nodesListView);
        nodeAdaptor.addNodes();
        listView.setAdapter(nodeAdaptor);
        listView.setKeepScreenOn(true);
        
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> av, View v, int pos,
					long id) {
				
	            Intent newIntent = new Intent(PowerStatus.this,NodeData.class);
	            newIntent.putExtra("indexs", nodeAdaptor.getItemId(pos)+" ");
				startActivity(newIntent);
				
			}
		});
        
        }

}
